/*
 * Copyright 2012 ITC Tsinghua University. All Rights Reserved.
 */
package cn.edu.tsinghua.cic.ccss.dto;

import org.forten.utils.common.StringUtil;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">Duyi</a>
 * 
 * @since 2012-5-8
 */
public class CadreDto implements SuperCadreDto {
	private static final long serialVersionUID = 8947871080442860599L;

	private Long id;
	private String cardNum;
	private String name;
	private String sex;
	private String unitName;
	private String jobLevel;
	private String duty;
	private String postTime;
	private String nation;
	private String titles;
	private String education;
	private String party;
	private String birthday;
	private String email;
	private String mobileNum;
	private String officeTel;
	private int currentMonthTotalCredit;
	private int nextMonthTotalCredit;
	private String isNewFlag;
	private String memo;

	public CadreDto() {
		super();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCardNum() {
		return cardNum;
	}

	public void setCardNum(String cardNum) {
		if (StringUtil.hasText(cardNum))
			this.cardNum = cardNum.trim();
		else
			this.cardNum = "";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		if (StringUtil.hasText(name))
			this.name = name.trim();
		else
			this.name = "";
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		if (StringUtil.hasText(sex))
			this.sex = sex.trim();
		else
			this.sex = "";
	}

	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		if (StringUtil.hasText(nation))
			this.nation = nation.trim();
		else
			this.nation = "";
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		if (StringUtil.hasText(education))
			this.education = education.trim();
		else
			this.education = "";
	}

	public String getParty() {
		return party;
	}

	public void setParty(String party) {
		if (StringUtil.hasText(party))
			this.party = party.trim();
		else
			this.party = "";
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		if (StringUtil.hasText(birthday))
			this.birthday = birthday.trim();
		else
			this.birthday = "";
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		if (StringUtil.hasText(unitName))
			this.unitName = unitName.trim();
		else
			this.unitName = "";
	}

	public String getJobLevel() {
		return jobLevel;
	}

	public void setJobLevel(String jobLevel) {
		if (StringUtil.hasText(jobLevel))
			this.jobLevel = jobLevel.trim();
		else
			this.jobLevel = "";
	}

	public String getPostTime() {
		return postTime;
	}

	public void setPostTime(String postTime) {
		this.postTime = postTime;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		if (StringUtil.hasText(email))
			this.email = email.trim();
		else
			this.email = "";
	}

	public String getMobileNum() {
		return mobileNum;
	}

	public void setMobileNum(String mobileNum) {
		if (StringUtil.hasText(mobileNum))
			this.mobileNum = mobileNum.trim();
		else
			this.mobileNum = "";
	}

	public String getOfficeTel() {
		return officeTel;
	}

	public void setOfficeTel(String officeTel) {
		if (StringUtil.hasText(officeTel))
			this.officeTel = officeTel.trim();
		else
			this.officeTel = "";
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		if (StringUtil.hasText(memo))
			this.memo = memo.trim();
		else
			this.memo = "";
	}

	/**
	 * @return the duty
	 */
	public String getDuty() {
		return duty;
	}

	/**
	 * @param duty
	 *            the duty to set
	 */
	public void setDuty(String duty) {
		if (StringUtil.hasText(duty))
			this.duty = duty.trim();
		else
			this.duty = "";
	}

	/**
	 * @return the currentMonthTotalCredit
	 */
	public int getCurrentMonthTotalCredit() {
		return currentMonthTotalCredit;
	}

	/**
	 * @param currentMonthTotalCredit
	 *            the currentMonthTotalCredit to set
	 */
	public void setCurrentMonthTotalCredit(int currentMonthTotalCredit) {
		this.currentMonthTotalCredit = currentMonthTotalCredit;
	}

	/**
	 * @return the nextMonthTotalCredit
	 */
	public int getNextMonthTotalCredit() {
		return nextMonthTotalCredit;
	}

	/**
	 * @param nextMonthTotalCredit
	 *            the nextMonthTotalCredit to set
	 */
	public void setNextMonthTotalCredit(int nextMonthTotalCredit) {
		this.nextMonthTotalCredit = nextMonthTotalCredit;
	}

	/**
	 * @return the isNewFlag
	 */
	public String getIsNewFlag() {
		return isNewFlag;
	}

	/**
	 * @param isNewFlag
	 *            the isNewFlag to set
	 */
	public void setIsNewFlag(String isNewFlag) {
		if (StringUtil.hasText(isNewFlag))
			this.isNewFlag = isNewFlag.trim();
		else
			this.isNewFlag = "";
	}

	/**
	 * @return the titles
	 */
	public String getTitles() {
		return titles;
	}

	/**
	 * @param titles
	 *            the titles to set
	 */
	public void setTitles(String titles) {
		if (StringUtil.hasText(titles))
			this.titles = titles.trim();
		else
			this.titles = "";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CadreDto other = (CadreDto) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "CadreDto [id=" + id + ", cardNum=" + cardNum + ", name=" + name
				+ ", sex=" + sex + ", unitName=" + unitName + ", jobLevel="
				+ jobLevel + ", duty=" + duty + ", postTime=" + postTime
				+ ", nation=" + nation + ", education=" + education
				+ ", party=" + party + ", birthday=" + birthday + ", email="
				+ email + ", mobileNum=" + mobileNum + ", officeTel="
				+ officeTel + ", currentMonthTotalCredit="
				+ currentMonthTotalCredit + ", nextMonthTotalCredit="
				+ nextMonthTotalCredit + ", isNewFlag=" + isNewFlag + ", memo="
				+ memo + "]";
	}
}
